package com.sykj.qiaoli.service.Impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sykj.qiaoli.bean.casea.CaseSettle;
import com.sykj.qiaoli.mapper.Casemapper.CaseSettleMapper;
import com.sykj.qiaoli.service.CaseSettleService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @program: lawfirm
 * @description: 结案业务实现类
 * @author: qiaoli
 * @create: 2020-05-15 10:06
 */
@Service
public class CaseSettleServiceImpl extends ServiceImpl<CaseSettleMapper,CaseSettle > implements CaseSettleService {

    @Override
    public List<CaseSettle> queryAll(CaseSettle caseSettle) {
        if(caseSettle==null){
            caseSettle=new CaseSettle();       }
        QueryWrapper<CaseSettle> queryWrapper=new QueryWrapper<>();
        if(caseSettle.getLawId()!=0){
            queryWrapper.eq("law_id",caseSettle.getLawId());
        }else  if(!("").equals(caseSettle.getBusinessName()) && !caseSettle.getBusinessName().equals(null)){
            queryWrapper.eq("business_name",caseSettle.getBusinessName());
        }else  if(!("").equals(caseSettle.getStatus()) && !caseSettle.getStatus().equals(null)){
            queryWrapper.eq("status",caseSettle.getStatus());
        }else  if(!("").equals(caseSettle.getSettleApplicationDate()) && !caseSettle.getSettleApplicationDate().equals(null)){
            queryWrapper.ge("settle_application_date",caseSettle.getSettleApplicationDate());
        }else  if(!("").equals(caseSettle.getSettletime()) && !caseSettle.getSettletime().equals(null)){
            queryWrapper.le("settle_proposer",caseSettle.getSettletime());
        }

        return this.baseMapper.selectList(queryWrapper);


    }
}
